#! /bin/bash

set -e
psql -v ON_ERROR_STOP=1 --username="$POSTGRES_USER" <<-EOSQL
\c auth2_db;
create table if not exists users (
  user_name VARCHAR(50) primary key NOT NULL,
  pwd VARCHAR(200) NOT NULL,
  full_name VARCHAR(100),
  alias VARCHAR(50),
  avatar VARCHAR(100),
  gender VARCHAR(10),
  birthday DATE,
  address VARCHAR(100),
  phone_number VARCHAR(40),
  email VARCHAR(50),
  bio VARCHAR(300),
  following_count INTEGER,
  followers_count INTEGER,
  friends_count INTEGER,
  post_count INTEGER,
  registration_time TIMESTAMP,
  last_login_time TIMESTAMP,
  privacy_settings VARCHAR(20),
  user_type VARCHAR(20),
  account_status VARCHAR(20)
);


END;
EOSQL
